import math


# class Circle(object):
#
#     def __init__(self, radius):
#         self.radius = radius
#
#     def calculate_area(self):
#         return round(math.pi * (self.radius ** 2),2)
#
#     def calculate_circumference(self):
#         return round(2 * math.pi * self.radius, 2)
#
# c1 = Circle(10)
#
# c2 = Circle(20)
#
# print(f"c1的周长{c1.calculate_circumference()},c1的面积：{c1.calculate_area()}")
# print(f"c2的周长{c2.calculate_circumference()},c2的面积：{c2.calculate_area()}")

# class Person(object):
#     def __init__(self, name, healthy=100):
#         self.name = name
#         self.healthy = healthy
#
#     def kick_dog(self, dog):
#         print(f"{self.name} 踢了{dog.name}一下")
#         dog.decrease_health(10)
#
#     def decrease_health(self, mount):
#         self.healthy -= mount
#
# class Dog(object):
#     def __init__(self, name, healthy=100):
#         self.name = name
#         self.healthy = healthy
#
#     def bite(self, person):
#         print(f"{self.name} 踢了{person.name}一下")
#         person.decrease_health(20)
#         # self.healthy -= 1
#
#     def decrease_health(self, mount):
#         self.healthy -= mount
#
#
# yuan = Person("yuan")
# alex = Dog("alex")
#
# alex.bite(yuan)
# print(yuan.healthy)
# yuan.kick_dog(alex)
# yuan.kick_dog(alex)
# yuan.kick_dog(alex)
# print(alex.healthy)

# class BankAccount(object):
#     def __init__(self,account_num, balance = 0):
#         self.account = account_num
#         self.balance = balance
#
#     def deposit(self, mount):
#         print(f"{self.account}存款{mount}元！")
#         self.balance = self.balance + mount
#
#     def withdraw(self, amount):
#         if self.balance >= amount:
#             self.balance = self.balance - amount
#             print(f"{self.account}取款{amount}元！,当前余额：{self.balance}")
#         else:
#             print("提取金额大于余额！")
#
#     def get_balance(self):
#         return self.balance
#
# account01 = BankAccount("123456", 10000)
# account01.deposit(20000)
# account01.withdraw(50000)
# account01.withdraw(5000)
class Book(object):
    book_list = []
    book_count = 0
    def __init__(self, title, author, publication_year):
        self.title = title
        self.author = author
        self.publication_year = publication_year

        Book.book_list.append(self)
        Book.book_count += 1

    @ classmethod
    def show_books(cls):
        for book in cls.book_list:
            print(book.title, book.author, book.publication_year)

book01 = Book("西游记", "yuan", 2000)
book02 = Book("水浒传", "rain", 3000)
book03 = Book("三国演义", "eric", 4000)
book04 = Book("金瓶梅","alvin", 10000)

Book.show_books()
print(Book.book_count)